// src/api/chatApi.js
import instance from '../utils/request.js'; // 修正路径，从 src/utils/ 导入

export const sendChatMessage = (data) => instance.post('/aichat/ask', data);
export const sendChatMessageStream = (data) => {
  return new EventSource(`${instance.getUri()}/aichat/ask/stream?data=${encodeURIComponent(JSON.stringify(data))}`);
};
export const loadDialog = (dialogId) => instance.get(`/aichat/load?dialogId=${dialogId}`);